package com.tyc.server.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * @Description: java类作用描述
 * @Author: tyc
 * @CreateDate: 2021/2/5 14:07
 */
@RestController
@RequestMapping("ser2")
@RefreshScope
public class TestController {
    @Value("${test.name}")
    private String name;

    @GetMapping()
    public String getName() throws InterruptedException {
        TimeUnit.SECONDS.sleep(3);
        return name;
    }
}
